﻿<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../../../assets/docs.css" rel="stylesheet" type="text/css" media="screen" />
<title>MooTools Documentation - Locale/Locale.Set.From</title>
</head>

<body>
  <div class="doc">
    <div class="methods">
			<h4 class="menu-item"><a href="#Locale-Set">Locale.Set</a></h4>
			<div class="menu-item"><a href="#Locale-Set:Locale-Set-from">Locale.Set.from</a></div>
    </div>
    <div class="l-border r-border span-15 content">
				<h1 id="Locale-Set"><a href="#Locale-Set">Class: Locale.Set</a></h1>

<p class="description">Extends <em>Locale.Set</em> (the class which Locale sets are an instance of) with a function to create locale sets from a JSON string. This locale set can then be used through <a href="Locale.html#Locale:use">Locale.use</a> to set as current locale.</p>

<h2 id="Locale-Set:Locale-Set-from"><a href="#Locale-Set:Locale-Set-from">Function: Locale.Set.from</a></h2>

<p class="description">Returns a <em>Locale.Set</em> containing the language items described in the JSON string.</p>

<h3>Syntax</h3>

<pre class="javascript">Language.<span class="me1">Set</span>.<span class="me1">from</span><span class="br0">(</span>str<span class="br0">)</span>;
</pre>

<h3>Arguments</h3>

<ol>
<li>str - (<em>string</em>) a JSON string.</li>
</ol>
<h3>Example</h3>

<pre class="javascript"><span class="kw2">var</span> json = <span class="st0">'{"name":"en-US","sets":{"FormValidator":{"required":"This field is required."}}}'</span>;
<span class="kw2">var</span> mySet = Locale.<span class="me1">Set</span>.<span class="me1">from</span><span class="br0">(</span>json<span class="br0">)</span>;
Locale.<span class="kw2">use</span><span class="br0">(</span>mySet<span class="br0">)</span>; <span class="co1">// mySet is now the current locale</span>
</pre>

<h3>Returns</h3>

<ul>
<li>(<em>object</em>) A new <em>Locale.Set</em> instance.</li>
</ul>
    </div>
  </div>
<script type="text/javascript" src="../../../assets/mootools-core-1.3.js"></script>
<script type="text/javascript" src="../../../assets/mootools-more-smoothscroll.js"></script>
<script type="text/javascript" src="../../../assets/doc-assist.js"></script>
</body>
</html>
